<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Display</title>
  <style>
    *{
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .display{
      margin: 100px auto;
      position: relative;
      width: 700px;
      height: 400px;
      border: 1px solid red;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-content: flex-start;
    }
    .display>div{
      width: 100px;
      height: 100px;
      border: 1px solid gray;
      opacity: .5;
      font-size: 12px;
    }
    .display>div:nth-child(2){
      order: 0;
    }
    .display>div:nth-child(3){
      order: 4;
    }
    .display>div:nth-child(6){
      order: 5;
    }
    .display>div:nth-child(6){
      background-color: #aaaaaa;
      flex-grow: 1;
    }
    .display>div:nth-child(8){
      align-self: auto;
    }
  </style>
</head>
<body>
  <div class="display">
    <div>设为 Flex 布局以后，子元素的float、clear和vertical-align属性将失效。</div>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7align-self属性允许单个项目有与其他项目不一样的对齐方式，可覆盖align-items属性。</div>
    <div>8flex属性是flex-grow, flex-shrink 和 flex-basis的简写，默认值为0 1 auto。后两个属性可选</div>
  </div>
</body>
</html>